<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="author" content="lijinbo" />
    <title>027-dom事件代理</title>
    <style>
      .max {
        display: flex;
      }

      .box_item {
        border: 1px solid #f87;
        margin: 20px;
      }

      p {
        text-align: center;
      }
    </style>
  </head>

  <body>
    <div class="max">
      <div class="box_item">
        <button onclick="addDom()">动态添加dom</button>
        <p>直接绑定</p>
        <br />
        <ul id="ulBox1">
          <li data-type="a">1</li>
          <li data-type="b">2</li>
          <li data-type="c">3</li>
          <li data-type="d">4</li>
          <li data-type="e">5</li>
        </ul>
      </div>
      <div class="box_item">
        <button onclick="addDom()">动态添加dom</button>
        <p>事件代理</p>
        <br />
        <ul id="ulBox2">
          <li data-type="a">1</li>
          <li data-type="b">2</li>
          <li data-type="c">3</li>
          <li data-type="d">4</li>
          <li data-type="e">5</li>
        </ul>
      </div>
    </div>
    <script type="module" src="./027-main.js"></script>
  </body>
</html>
